package com.baidu.speech.qr_code.ui.notifications;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.baidu.speech.qr_code.R;

import org.litepal.LitePal;

import java.util.ArrayList;
import java.util.List;

public class Notifications_Personal_signature extends AppCompatActivity{

    private TextView tv_return;
    private EditText ed_personal_portrait;
    private Button bu_release;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_notifications__personal_signature);
        initView();
    }

    private void initView() {
        tv_return = (TextView) findViewById(R.id.tv_return);
        //返回按钮
        tv_return.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
        }
        });
        ed_personal_portrait = (EditText) findViewById(R.id.ed_personal_portrait);
        Personal_signature1 ps= LitePal.findLast(Personal_signature1.class);
        ed_personal_portrait.setText(ps.getSignature());
        bu_release = (Button) findViewById(R.id.bu_release);
        bu_release.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Personal_signature1 personal_signature1=new Personal_signature1();
                personal_signature1.setSignature(ed_personal_portrait.getText().toString().trim());
                personal_signature1.save();
                Log.d("TAG", "onClick"+personal_signature1.getSignature());
                finish();
            }
        });
    }
}